#include "winmain.h"
#include <QMessageBox>

winMain::winMain(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);
	txtInput = findChild<QTextEdit*>("txtInput");
	btnProcess = findChild<QPushButton*>("btnProcess");

	connect(btnProcess, SIGNAL(clicked()), this, SLOT(process()));

}

int winMain::hex2bin_c(unsigned int c)
{
	if (c >= '0' && c <= '9')
		return c - '0';
	if (c >= 'A' && c <= 'F')
		return c - 'A' + 10;
	if (c >= 'a' && c <= 'f')
		return c - 'a' + 10;
	return -1;
}

void winMain::process() {
	QMessageBox::information(this, "Sup", QString::number(hex2bin_c( 'F' )));
}

winMain::~winMain()
{

}
